<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Router</title>
    <script src="jquery/jquery-1.11.2.js"></script>
    <script src="underScore/underscore.js"></script>
    <script src="backbone-min.js"></script>
</head>
<body>
<a href="#actions">testActions</a>
<a href="#/posts/120">Post 120</a>
<a href="#/download/user/images/hey.gif">download gif</a>
<a href="#/dashboard/graph">Load Route/Action View</a>
<h3>
    navigate
</h3>
<script>
    var AppRouter = Backbone.Router.extend({
        routes:{
            "posts/:id":"getPost",
            "download/*path":"downloadFile",
            "route/:action":"loadView",
            "*actions":"defaultRoute"
        },
        getPost:function(id){
            alert(id);
        },
        defaultRoute:function(actions){
            alert(actions);
        },
        downloadFile:function(path){
            alert(path);
        },
        loadView:function(route,action){
            alert(route+"_"+action);
        }
    });
    var app_router = new AppRouter;
    Backbone.history.start();
</script>

</body>
</html>